# @arthor quoc.le
#! C:/Perl/bin/perl -w
use strict;
use warnings;
use diagnostics;

# my @array = map $_** 2, 1..10;
# print "@array\n";

my $str = '1:one,2:two,3:three,4:four';
my %hash = map { split /:/, $_ } split /,/, $str;

# print the hash
while ( my ($key, $val) = each %hash ) {
  print "$key->$val\n";
}

my $s1 = 'r0:r1:r2:r3:r4:rt:rt0';
my @arr1 = split(':',$s1);
my $s2 = 'r2:r1:rt:rt0:r3:r4:r0';
my @arr2 = split(':',$s2);
my %hash2 = map {@arr1} @arr2;